#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from src.com.itheima.web.service.meitu_service import MeizituService


def main():
    while True:
        command=input("请选择命令:\n"
                      "1:下载美女图片[全量下载]"
                      "2:下载美女图片[按照页码]"
                      "3.退出")
        if '1'==command:
            this=MeizituService()
            for i in range(354):
                this.downImgsByPage(str(i + 1))
        elif '2'==command:
            this = MeizituService()
            while True:
                try:
                    page=input("[输入非数字回到上一层]请输入下载页码>>>")
                    this.downImgsByPage(page)
                except:
                    print(111)
                    break
        elif '3' == command:
            break
        else:
            print("不支持当前命令")
            continue


if __name__ == '__main__':
    main()